<table class="common-table">
	<thead>
		<tr>
			<th width="70px;">留言者</th>
			<th width="50px;">类型</th>
			<th>内容</th>
			<th width="80px;">时间</th>
			<th width="50px;">操作</th>
			<th width="25px;">删</th>
		</tr>
	</thead>
	<tbody>
		#{if msgs}
			#{list items:msgs, as:'msg'}
				<tr>
					<td class="main_message">${msg.author}</td>
					<td>
						<font class="important_1">
						#{if msg.type == models.Message.MessageType.CONSULTING}[咨询]#{/if}
						#{if msg.type == models.Message.MessageType.SUGGEST}[建议]#{/if}
						#{if msg.type == models.Message.MessageType.REFUND}[退款]#{/if}
						#{if msg.type == models.Message.MessageType.OTHER}[其他]#{/if}
						</font>
					</td>
					<td class="msgContent main_message">${msg.content}</td>
					<td>${msg.lastModifiedAt.format("yyyy-MM-dd hh:mm:ss")}</td>
					<td>
						<font color="red"><a href="javascript:openDialog(${msg.id});" >[回复]</a></font>
					</td>
					<td>
						<a href="javascript:removeItem(${msg.id})" title="删除">
							<img class="minImg" src="@{'public/images/delete.gif'}">
						</a>
					</td>
				</tr>
				#{if msg.replys}	
		      		#{list items:msg.replys, as:'reply'}
		      			<tr>
			      			<td colspan="2">
			      			</td>
							<td class="msgContent">
								#{if reply.createByAdmin}
			      				管理员
			      				(<font class="important_1_1">${reply.createByAdmin.username}</font>)
			      				#{/if}
			      				#{if reply.createByUser}
			      				<font class="important_1_1">${reply.createByUser.username}</font>
			      				#{/if}
			      				[回复]:&nbsp;
								${reply.content}
							</td>
							<td>${reply.lastModifiedAt.format("yyyy-MM-dd hh:mm:ss")}</td>
							<td></td>
							<td>
								<a href="javascript:removeItem(${reply.id})" title="删除">
									<img class="minImg" src="@{'public/images/delete.gif'}">
								</a>
							</td>
			      		</tr>	
					#{/list}
			    #{/if}
			#{/list}
		#{/if}
		#{else}
			<tr>
				<td colspan="6">没有查询到记录。</td>
			</tr>
		#{/else}
	</tbody>
</table>
<div id="pager" style="font-size:1.3em;"></div>
<script language="javascript">
//初始化翻页控件。
function initialPager() {
	$("#pager").pager(
		{
			pagenumber: ${queryBean.currentPage}, 
			pagecount: ${queryBean.totalPage}, 
			totalcount: ${queryBean.totalQuantity},
			buttonClickCallback: PageClick
		}
	);
}
//翻页功能。
function PageClick(pageclickednumber) {
	$("#currentPage").val(pageclickednumber);
	reloadTable();
}
</script>